/**
 * File ExceptionMessageHelper.java created by Pablo Díaz Fernández
 * on 27/10/2011 for the project supply-chain-simulator
 */
package org.lsk.pfc.scsim.model.messages;

import java.text.MessageFormat;

/**
 * Class that provides messages to show in exceptions.
 * 
 * @author Pablo Díaz Fernández
 * 
 */
public final class ExceptionMessageHelper {

	/**
	 * Private constructor to avoid instantiation.
	 */
	private ExceptionMessageHelper() {
	}

	/**
	 * Creates a formatted message using the parameter and the key to get the
	 * message exception template from the properties file.
	 * 
	 * @param messageKey
	 *            Key to the message template.
	 * @param parameter
	 *            Parameter to set.
	 * 
	 * @return Message formatted.
	 */
	public static String createMessage(final String messageKey,
	        final String parameter) {
		return MessageFormat.format(getMessageTemplate(messageKey), parameter);
	}

	/**
	 * Gets the message template from the properties file.
	 * 
	 * @param messageKey
	 *            Key to find.
	 * 
	 * @return Message found
	 */
	private static String getMessageTemplate(final String messageKey) {
		return "Error in {0}\n";
	}
}
